home *** CD-ROM | disk | FTP | other *** search
/ Utilities Professional 1-1500 / Utilities Professional 1-1500 (1994)(WPD)[!].iso / 12511500 / var1463.dms / var1463.adf / BBBBS72.lha / libs / DOCS / rexxarplib.doc next >
Text File  |  1994-04-20  |  56KB  |  1,159 lines

  1. +----------------------------------------------------------------------+
  2. |                                                                      |
  3. |                  D I S C L A I M E R   N O T I C E                   |
  4. |                                                                      |
  5. |  This document and/or  portions of the material and  data furnished  |
  6. |  herewith,  was developed under sponsorship of the U.S. Government.  |
  7. |  Neither the U.S.  nor  the U.S.D.O.E.,  nor  the  Leland  Stanford  |
  8. |  Junior University, nor their employees,  nor their respective con-  |
  9. |  tractors, subcontractors, or their employees, makes  any warranty,  |
  10. |  express or implied, or assumes any liability or responsibility for  |
  11. |  accuracy,  completeness or  usefulness of any information, appara-  |
  12. |  tus, product or process disclosed, or represents that its use will  |
  13. |  not infringe privately-owned rights.  Mention of any product,  its  |
  14. |  manufacturer, or suppliers shall not, nor is it intended to, imply  |
  15. |  approval, disapproval, or fitness for any particular use. The U.S.  |
  16. |  and  the University at all times  retain the right to use and dis-  |
  17. |  seminate same for any purpose whatsoever.                           |
  18. |                                                                      |
  19. +----------------------------------------------------------------------+
  20.  
  21.  
  22.                     RexxArpLib.Library Version 3.3
  23.                     ==============================
  24.  
  25.                                 by
  26.  
  27.                           W.G.J. Langeveld
  28.                  Stanford Linear Accelerrator Center
  29.  
  30.              Copyright (C) 1988, 1989, 1990, 1992, 1993, 1994
  31.            The Trustees of the Leland Stanford Junior University
  32.  
  33.                         All Rights Reserved
  34.  
  35. Version 3.3:
  36. ------------
  37.  
  38.     This version of rexxarplib is released mainly because there is no
  39. reason not to. It doesn't add much beyond version 3.0.
  40.     The major new thing is a moderately useful List requester
  41. (see RequestList).
  42.     Also, a few small bugs were fixed. Under 2.0x and up,
  43. screenshare.library is now truely no longer needed - before, it would mess
  44. up some of the 3-D look if screenshare.library was not present even under
  45. 2.0.
  46.     Another function that always was present is now documented:
  47. SendParsed, which is sometimes useful.
  48.     This may be the last version of rexxarplib to be released.
  49.  
  50.         20 April 1994, WGL
  51.  
  52. Version 3.0:
  53. ------------
  54.  
  55.     This version of rexxarplib makes use of a lot of AmigaDOS 2.0
  56. features and has various bugs fixed and a few other enhancements. Yet, it is
  57. smaller than previous versions because it is now completely compiled using
  58. SAS/C version 5.10a.
  59.     Under AmigaDOS 2.0, rexxarplib will now use the ASL file requester
  60. rather than the ARP one. The GetFile() function acquired some new arguments
  61. in order to allow you to use most of the features of the ASL requester (such
  62. as specifying its size and adding pattern gadgets or setting it up as a
  63. directory requester or using multiple select). *NOTE*. Various features of
  64. the ASL file requester only work correctly under versions of AmigaDOS
  65. *after* 2.02. Some features may not appear to work at all in early versions
  66. of 2.0, one of them is the "NOFILES" option. If you definitely *want* to use
  67. the ARP file requester, you can, by specifying a flag.
  68.     There is a new function called GetFont() which brings up the new
  69. ASL font requester. It too has lots of options and arguments. The SetFont()
  70. function never worked correctly but should now be fixed. It has also acquired
  71. a few more arguments, to go with the font requester.
  72.     Furthermore, under AmigaDOS 2.0, you should no longer need
  73. screenshare.library (at least not for rexxarplib.library - other programs may
  74. still require it!). It uses 2.0 public screens everywhere. This also means
  75. that you can use rexxarplib functions to operate on other applications'
  76. screens (if they are AmigaDOS 2.0 public ones). Applications that still open
  77. screenshare shared screens are still supported: if screenshare.library is
  78. available and a requested public screen does not exist as a 2.0 public
  79. screen, rexxarplib will try to find a screenshare-style screen of that name.
  80. Under AmigaDOS 1.3, rexxarplib of course uses screenshare.library exclusively.
  81. Support was also added for the long missing BACKDROP flag to OpenWindow.
  82.     Rexxarplib.library uses as much as possible the 2.0 3-D look, though
  83. there are cases where it decides (based on the colors for example) to use a
  84. slightly different rendering. In order to support more of the new 2.0
  85. features, the number of arguments to OpenScreen has been increased. You can
  86. now specify the width and height, as well as the coordinates of the top-left
  87. corner, and you can give it AutoScroll and Overscan flags. You can make
  88. as large a screen as AmigaDOS 2.0 allows and scroll around for example. Also,
  89. a MoveScreen() function was added to allow moving screens around from ARexx.
  90.     Under 2.0 you can now specify "Workbench" as a Public Screen Name.
  91. This means that some functions (such as ScreenColor()) will now also work for
  92. the Workbench. For some reason, ShowTitle() does not which is just as well
  93. anyway.    The number of arguments to ScreenColor() was increased so you can set
  94. the colors of a screen without having to open a window on it and you can also
  95. determine the colors of the screen using this function.
  96.     This version has new Getenv() and Setenv() functions. These functions
  97. are now compatible with the 2.0 environment variable system and use the
  98. GetVar, SetVar and DeleteVar routines. If GetVar fails, it will fall back
  99. to the ARP Getenv function. Under 1.3, the behavior is the same as before.
  100.     There is a new flag argument with AddGadget() for string gadgets.
  101. One possible flag is RIDGEBORDER. This causes string gadgets to have the
  102. "standard" 2.0 three-dimensional border. This is not the default, because
  103. this type of border requires a little more space and might break ARexx
  104. programs that assume the size is as before. Another flag was added to
  105. allow the gadget to be defined as a NUMERIC gadget.
  106.     Other than that, gadgets on two-color screens should now have visible
  107. gadget borders (by default - it is still possible to change them) and the
  108. colors should default to the proper values for the screen the window opens
  109. up on. Note that under 2.0 the colors your application comes up with may
  110. be a little different from what you would have expected. You can adjust the
  111. colors by using the SetReqColor() function.
  112.     Bugs fixed: the Flood() routine ran *very* slowly because it didn't
  113. have a TmpRas. Now, a TmpRas is allocated before the Flood operation is
  114. actually done, and the function is orders of magnitude faster. This actually
  115. used to work correctly in an earlier version of rexxarplib but broke in one
  116. of the more recent ones. Under AmigaDOS 1.3 the colors that some requesters
  117. used could be random in certain conditions. The createhost function didn't
  118. check correctly whether there were any messages it had sent out that were not
  119. yet replied to before closing down. The FileList function used a construct
  120. that was not reentrant. A minor problem in PostMsg() was also fixed. A little
  121. bug in AddGadget was fixed which could potentially cause enforcer hits if
  122. certain arguments were left unspecified. All these should be fixed.
  123.     Many thanks to the various beta testers - you know who you are!
  124.  
  125.     25 April 1991, WGL
  126.  
  127.  
  128. Version 2.52:
  129. -------------
  130.  
  131.     This release was necessary to fix problems with AmigaDOS 2.0
  132. shared screens. As of version 1.45, screenshare.library supports 2.0-style
  133. shared screens, but the previous versions of rexxarplib contained code that
  134. would prevent some functions to work with such screens because they have
  135. slightly different properties. Do not forget to install the new
  136. screenshare.library in libs:.
  137.  
  138.     16 October 1990, WGL
  139.  
  140.  
  141. Version 2.5:
  142. ------------
  143.  
  144.     Minor update. Two bugs in the FileList function were fixed: the third
  145. argument wouldn't work right if there was a fourth, and the Noexpand option was
  146. broken in the previous version. A problem in the documentation of some of the
  147. screen functions (ScreenRows/Cols/Lace/Color/ToBack/ToFront) was corrected. A
  148. ShowTitle function was added. The CreateHost function was modified, such that if
  149. the named public screen does not exist, the window will open on the WorkBench.
  150. Under 2.0, rexxarplib's screens now get the "3D" look. Some other esthetical
  151. problems with 2.0 were also fixed.
  152.  
  153.     22 August 1990, WGL
  154.  
  155.  
  156. Version 2.42 (internal release):
  157. -------------------------------
  158.  
  159.     Another minor update. The PostMsg() code was fixed for two little bugs:
  160. (1) when calling PostMsg() in rapid sequence from different ARexx programs, it
  161. was possible to wind up with an orphaned PostMsg window that would never go
  162. away; (2) after updating an existing PostMsg() window on a shared custom screen,
  163. it was impossible to ever close that screen.
  164.     The Area... functions have been completely rewritten. While they used to
  165. be simple interfaces to the AmigaDOS equivalents, they are no longer, although
  166. they still use the AmigaDOS functions down below. Advantages: areafills are now
  167. clipped against the window borders, there are 16 specific pattern fills and 125
  168. dithering patterns, the fills no longer take up as much memory as they used to,
  169. and the probability of a system crash with these functions is considerably
  170. reduced. "Problems": AreaEnd() now has an optional argument and SetOPen is now
  171. obsolete (See AreaEnd()), and fills involving areacircles and areaellipses that
  172. don't fit inside the window may now fail and only produce the outline of the
  173. fill.
  174.     Other minor changes: ScreenToFront/Back now return 0 when the screen
  175. doesn't exist, rather than signalling an error. Windows no longer have their
  176. minimum size set to their original size, so you can use sizing gadgets to
  177. make windows smaller too. Boolean gadgets now also have their GADGIMMEDIATE
  178. flag set, so that GADGETDOWN messages are actually possible now. Note, that
  179. when you request to receive both GADGETUP and GADGETDOWN messages, each
  180. gadget will report to you its message string *twice*. They can be distinguished
  181. by including %l in the message string, so that you can parse on UP vs. DOWN.
  182. The OpenScreen() function acquired another flag, TRUNCATE. See the description
  183. of OpenScreen(). A few little bugs were fixed in IFFImage. Note: iff.library
  184. apparently still has some bugs. It may still cause crashes of the machine when
  185. used with DPaint brushes. When in doubt, use full IFF pictures. Send mail to
  186. Chris Weber to have it fixed...
  187.     And finally, the entire code was carefully checked and improved to avoid
  188. crashes under low-memory situations.
  189.  
  190.     21 January 1990, WGL
  191.  
  192.  
  193. Version 2.3:
  194. -------------
  195.  
  196.     Minor update. A new option was added to FileList to inhibit expansion of
  197. file names where not wanted. DrawCircle apparently never worked, can't believe
  198. noone noticed: it is fixed now. A small bug in the simple requester code was
  199. found and fixed, as well as a few similar ones in the file requester interface
  200. code. Finally: the 'version' command will now properly display the version
  201. number of rexxarplib and rexxmathlib.
  202.  
  203.     20 May 1989, WGL
  204.  
  205.  
  206. Version 2.2a:
  207. -------------
  208.  
  209.     A small bug fix in IffImage().
  210.  
  211.     5 April 1989, WGL
  212.  
  213.  
  214. Version 2.2:
  215. ------------
  216.  
  217.     New in version 2.2 is an extension to the FileList() function. It can
  218. now expand the file names to include the full path, by supplying another
  219. argument. It will now also return the number of files in the .0 field of the
  220. stem variable, to make it more similar to ExecIO. A bug was fixed...
  221.     Also, version 2.2 now uses ARP's Getenv and Setenv calls, so that with
  222. ARP 1.3 you can use environment variables in the ENV: directory.
  223.     Another addition is a new option for IFFImage() allowing one to load
  224. images without changing the screen's colors.
  225.     Missing from the documentation so far has been that rexxarplib.library
  226. *requires* the presence of screenshare.library and diskfont.library in your
  227. current libs: directory. Several reports about library functions only returning
  228. error 12 have been due to these libraries not being present.
  229.     There was also a mistake in the documentation. The function that used
  230. to be listed as FreeMenu() is really called RemoveMenu().
  231.     The behavior of GetEnv() was changed by popular request. It will no
  232. longer generate an error when the argument is not an existing env variable.
  233. Instead it will return an empty string.
  234.  
  235.     20 February 1989, 8 March 1989, WGL
  236.  
  237. Version 2.1:
  238. ------------
  239.  
  240.     New in version 2.1 are the general function ScreenColor, and the
  241. CreateHost-related functions ReadHost, SetGadget and IFFImage. The allowed
  242. flag for AddItem and AddSubItem is now a specific one (this is an "incompatible"
  243. change). CloseWindow now allows the host to stay around through a second
  244. argument. The window flag DELTAMOVE was added for OpenWindow, and the window
  245. location is now available in reports (%e and %f).
  246.     The function IFFImage needs some explanation. It allows you to display
  247. (a portion of) an IFF image in your CreateHost window. For the time being, this
  248. function makes use of the iff.library written by Christian Weber. However, there
  249. is a suspicion that this library may cause the occasional system crash, and it is
  250. known that DPaint-style brushes are not supported. Only straight IFF picture
  251. files are known to work more or less reliably. At some point I intend to use
  252. something else.
  253.  
  254. Version 2.0:
  255. ------------
  256.  
  257.     Originally, this library was supposed to be an ARexx interface to the
  258. ARP library. However, although it indeed interfaces to some of the ARP
  259. functions, it has become much more of an interface to various Intuition
  260. functions. I have considered renaming the library to something else, but by now
  261. everyone refers to it by this name, so I'll leave it like it is.
  262.     Version 2.0 is pretty much the final version. The library has grown
  263. considerably since the first release, and it is about as big as a library should
  264. ever get. If I find the need for a lot of other functions, they'll have to go
  265. into a different library.
  266.     The library contains over 50 functions now. One is Charlie's famous ARP
  267. file requester, another is a simple combination string/boolean requester that
  268. does auto-everything. All you have to do is specify the strings you want it to
  269. display. Then there are environment variable things, and a simple message window
  270. you can keep hanging around. On popular request, there is now a wildcard
  271. expander (not to be confused with a 'directory' function!) that uses the new Rexx
  272. Variables Interface (RVI).
  273.     The major new things though, are the interface routines to Intuition.
  274. You can now open screens and windows, add boolean and string gadgets to them as
  275. well as menus, draw lines and areas and circles and whatever. You can make your
  276. gadgets, menus, and windows send messages to wherever you like and you can
  277. format those messages, though they have to ARexx messages, in any way you like,
  278. using any information that's currently available. All this is rather hard to
  279. explain. You'll really have to play with it and look at some examples.
  280.     As usual, this stuff is NOT public domain, but freely distributable.
  281.  
  282.     So have fun!
  283.  
  284.     Willy.
  285.  
  286.  
  287.  
  288. The functions are listed below.
  289. --------------------------------------------------------------------------------
  290.  
  291. GetFile
  292. =======
  293.  
  294.     Calling sequence:
  295.  
  296.     result = GetFile(x, y, pathname, filename, hailstring, publicscreen,
  297.                          options, stemname, width, height, pattern)
  298.  
  299.     x            = x coordinate of top-left corner of requester.
  300.     y            = y coordinate of top-left corner of requester.
  301.     pathname     = Default path name, first path name to be searched.
  302.         filename     = Default file name.
  303.         hailstring   = User instruction string.
  304.         publicscreen = Name of a public screen (optional).
  305.  
  306.     Under 2.0, we use ASL and the following arguments are recognized:
  307.         options      = One or more of:
  308.                        NOFILES        Directory requester
  309.                        PATGAD         Add a pattern gadget
  310.                        SAVE           "Save" requester (different color)
  311.                        MULTISELECT    Enable multiple selections. This
  312.                                       option requires the presence of the
  313.                                       name of a stem variable (see next)
  314.                                       or else this option is ignored.
  315.                        MATCHDIRS      Pattern in filename applies to dirs too.
  316.                        DOARP          Use the ARP requester instead.
  317.         stemname     = Name of a stem variable to receive the result.
  318.         width        = Preferred width of the requester
  319.         height       = Preferred height of the requester
  320.         pattern      = Default pattern.
  321.  
  322.         result       = See below.
  323.  
  324.     All arguments are optional, but the order is fixed. Therefore if only
  325. the second or third argument is specified, it needs to be prefixed by
  326. sufficient commas.
  327.     The selected path concatenated with the selected file name are
  328. returned as 'result' unless the stemname is specified. If the stemname is
  329. specified, the result will always be given in the form of a stem variable:
  330. stemname.0 will contain the number of returned file names, and stemname.i
  331. with i = 1 through stemname.0 will contain the file names. The 'result'
  332. will be set to the number of files returned. In addition, stemname.Width,
  333. stemname.Height, stemname.TopEdge and stemname.LeftEdge will contain the
  334. last used size and position of the file requester. If PATGAD is specified
  335. among the options, stemname.Pattern will contain the (possibly modified)
  336. pattern.
  337.     About patterns: there are two ways to make the file requester
  338. only list files that match a certain pattern. The pattern may be specified
  339. as part of default directory argument or as the default pattern argument
  340. if PATGAD is specified as an option. The pattern present in the default
  341. directory specification will not be displayed anywhere, even if the PATGAD
  342. option is used and a pattern gadget is provided. Yet, only files matching
  343. the pattern will be shown. If PATGAD is used together with a pattern
  344. in the default pattern argument, the requester will show only the files
  345. that match that pattern, and that pattern itself will be shown in the
  346. pattern gadget. If there is both a pattern in the default directory and
  347. the default pattern arguments, then all files must match both patterns.
  348. However, this last restriction is only present as neither the directory
  349. nor the pattern gadget contents are modified.
  350.     The result is not necessarily an existing file. It is up to the user
  351. to ascertain that the result is suitable for his purposes. If the user hits
  352. "CANCEL", the result is an empty string and/or stemname.0 = 0. It is also
  353. possible for the user to enter a pattern in the File gadget. Such a pattern
  354. is not expanded, and returned as a file name.
  355.     Notice that another way the result comes out to be empty is when the
  356. user leaves the requester hitting "OKAY" when both the path and file string
  357. gadgets are empty.
  358.     If 'publicscreen' is specified, the function will try to find the screen
  359. of that name. If it is set up properly, the requester will open on that
  360. screen. If not, the requester will appear on the Workbench. Under AmigaDOS
  361. 1.3, screenshare.library is used for this purpose. Under AmigaDOS 2.0
  362. a "public" screen of that name will be looked for and if this fails,
  363. screenshare.library is used, if it is in libs:.
  364.  
  365. GetFont
  366. =======
  367.  
  368.     This function is AmigaDOS 2.0-only.
  369.  
  370.     Calling sequence:
  371.  
  372.     result = GetFont(x, y, fontname, fontsize, hailstring, publicscreen,
  373.                          options, stemname, minheight, maxheight,
  374.                          fontstyle, fontflags, frontpen, backpen)
  375.  
  376.     x            = x coordinate of top-left corner of requester.
  377.     y            = y coordinate of top-left corner of requester.
  378.     fontname     = Default font name, first font to be displayed.
  379.         fontsize     = Default font size.
  380.         hailstring   = User instruction string.
  381.         publicscreen = Name of a public screen (optional).
  382.         options      = One or more of:
  383.                        BACKPEN       Allow selection of background pen
  384.                        DRAWMODE      Allow selection of drawing mode
  385.                        FIXEDWIDTH    Only allow fixed-width fonts
  386.                        FRONTPEN      Allow selection of foreground pen
  387.                        STYLE         Allow selection of style attributes
  388.         stemname     = Name of a stem variable to receive the result.
  389.         minheight    = Minimum allowable font height.
  390.         maxheight    = Maximum allowable font height.
  391.         fontstyle    = Initial font style
  392.         fontflags    = Initial font flags
  393.         frontpen     = Initial front pen
  394.         backpen      = Initial back pen
  395.  
  396.     result       = See below.
  397.  
  398.     All arguments are optional, but the order is fixed. Therefore if only
  399. the second or third argument is specified, it needs to be prefixed by
  400. sufficient commas.
  401.     The selected font, concatenated with a "/" and the selected size is
  402. returned as 'result' unless the stemname is specified. If the stemname is
  403. specified, the result will always be given in the form of a stem variable:
  404.         stemname.Name     = font name
  405.         stemname.YSize    = vertical size of font
  406.         stemname.Style    = style flags for font (see SetFont())
  407.         stemname.Flags    = font flags           (see SetFont())
  408.         stemname.FrontPen = foreground pen
  409.         stemname.BackPen  = background pen
  410.         stemname.DrawMode = drawing mode (JAM1, JAM2, COMPLEMENT)
  411. In this case, 'result' will be just the font name if a selection was made.
  412.     Notice, that the result is not necessarily an existing font. It is
  413. up to the user to ascertain that the result is suitable for his purposes. If
  414. the user hits "CANCEL", the 'result' is an empty string.
  415.     Notice that another way the result comes out to be empty is when the
  416. user leaves the requester hitting "OKAY" when both the font and size string
  417. gadgets are empty. In this case, though, the stem variable may still contain
  418. the last selected or default values for items other than the name and size.
  419.     If 'publicscreen' is specified, the function will try to find the screen
  420. of that name. If it is set up properly, the requester will open on that screen.
  421. If not, the requester will appear on the Workbench. Under AmigaDOS 2.0 (this
  422. function only works under AmigaDOS 2.0) a "public" screen of that name will be
  423. looked for and if this fails, screenshare.library is used, if it is in libs:.
  424.     This function requires the presence of diskfont.library in libs:.
  425.  
  426. Request
  427. =======
  428.  
  429.     Calling sequence:
  430.  
  431.     result = Request(x, y, prompts, string, okaytext, canceltext, publicscreen)
  432.  
  433.     x             = x coordinate of top-left corner of requester.
  434.     y             = y coordinate of top-left corner of requester.
  435.         prompts       = A string which will be displayed above any gadgets.
  436.                         Any embedded '\' characters will be treated as a line
  437.                         break.
  438.         string        = The default string to be displayed in a string gadget.
  439.                         If omitted, no string gadget will be provided.
  440.     okaytext      = The text to be used for an Okay gadget.
  441.                     If omitted, no okay gadget will be provided.
  442.     canceltext    = The text to be used for a Cancel gadget.
  443.                     If omitted, no cancel gadget will be provided.
  444.         publicscreen  = Name of a public screen (optional).
  445.  
  446.     All arguments are optional, but the order is fixed. Therefore if
  447. only the second or third argument is specified, it needs to be prefixed by
  448. sufficient commas.
  449.     If a string gadget is present, but no okay gadget, the string
  450. will be returned after modification by the user in result when the user
  451. hits <return>.
  452.     If both a string gadget and an okay gadget are present, the string
  453. will be returned in result only when the user clicks on the okay gadget.
  454.     If no string gadget is present, clicking of the okay gadget (if
  455. present) will cause the return in result of the string "OKAY".
  456.     In any case, if the user clicks either the cancel gadget or the
  457. close gadget, an empty string will be returned. Notice that another way the
  458. result comes out to be empty is when the user leaves the requester hitting
  459. "OKAY" when the string gadget is empty.
  460.     If 'publicscreen' is specified, the function will try to find the screen
  461. of that name. If it is set up properly, the requester will open on that
  462. screen. If not, the requester will appear on the Workbench. Under AmigaDOS
  463. 1.3, screenshare.library is used for this purpose. Under AmigaDOS 2.0
  464. a "public" screen of that name will be looked for and if this fails,
  465. screenshare.library is used, if it is in libs:.
  466.  
  467.  
  468. RequestList
  469. ===========
  470.  
  471.     Calling sequence:
  472.  
  473.     result = RequestList(start, end, list, x, y, w, h, publicscreen, flags)
  474.  
  475.         start         = member number of list where display starts
  476.         end           = member number of list where display ends
  477.         list          = stem variable that holds the members to be displayed
  478.     x             = x coordinate of top-left corner of requester.
  479.     y             = y coordinate of top-left corner of requester.
  480.         w             = width of requester
  481.         h             = Height of requester
  482.         publicscreen  = Name of a public screen (optional).
  483.         flags         = flags.
  484.  
  485.     The first three arguments are required. All others are optional, but
  486. the order is fixed.
  487.     The stem variable is assumed to be of the form variable.i with i
  488. an integer number. It is usual that variable.0 contains the size of the
  489. list, and the members are variable.1, variable.2 etc. The list requester will
  490. display all the members starting with variable.start and ending with variable.end.
  491.     The only flag recognized is "SORT". If specified, the list will be
  492. sorted before display.
  493.     If 'publicscreen' is specified, the function will try to find the screen
  494. of that name. If it is set up properly, the requester will open on that
  495. screen. If not, the requester will appear on the Workbench.
  496.     This function works only under AmigaDOS 2.0x and up.
  497.  
  498. PostMsg
  499. =======
  500.  
  501.     This function sets up a window with text. It returns immediately to
  502. the caller. Subsequent calls will erase lines and fill them with new text.
  503. If a line has zero length, the line will NOT be erased. This has the advantage
  504. that you can change the text in a line without redisplaying text in another
  505. line. It has the disadvantage that in order to erase lines, you have to
  506. specify at least a single space for each line you want to erase.
  507. The window will remain open, until a call is made with too few arguments.
  508. This is NOT a reentrant function: there is only one window pointer, and
  509. subsequent calls by ANY REXX process will affect the window.
  510.  
  511.     Calling sequence:
  512.  
  513.     result = PostMsg(x, y, strings, publicscreen)
  514.  
  515.     x             = x coordinate of top-left corner of requester.
  516.     y             = y coordinate of top-left corner of requester.
  517.         string        = A string which will be displayed above any gadgets.
  518.                         Any embedded '\' characters will be treated as a line
  519.                         break.
  520.     result        = 1 for success, 0 otherwise.
  521.         publicscreen  = Name of a public screen (optional).
  522.  
  523.     All arguments are optional, but the order is fixed. Therefore if
  524. only the second or third argument is specified, it needs to be prefixed by
  525. sufficient commas.
  526.     Examples:
  527.        Postmsg(50, 50, "This is line 1\This is line 2")
  528. will cause a window to appear with two lines of text. A subsequent call
  529.        Postmsg(50, 50, "\This is a new line 2")
  530. will cause the second line of the window to be replaced by the new text. The
  531. construct:
  532.        PostMsg(50, 50, " \")
  533. will erase the first line but leave the second one alone (notice the space).
  534.     If too few arguments are specified, this function will cause the
  535. window to be closed.
  536.     If 'publicscreen' is specified, the function will try to find the
  537. screen of that name. If it is set up properly, the requester will open on
  538. that screen. If not, the requester will appear on the Workbench. Under
  539. AmigaDOS 1.3, screenshare.library is used for this purpose. Under AmigaDOS
  540. 2.0 a "public" screen of that name will be looked for and if this fails,
  541. screenshare.library is used, if it is in libs:.
  542.  
  543. Getenv
  544. ======
  545.  
  546.     Calling sequence:
  547.  
  548.     result = Getenv(variable)
  549.  
  550.     variable   = Environment variable.
  551.         result     = The value of the environment variable.
  552.  
  553.     This function gets the value of an environment variable. If the
  554. variable does not exist, an empty string will be returned.
  555.  
  556. Setenv
  557. ======
  558.  
  559.     Calling sequence:
  560.  
  561.     result = Setenv(variable, valuestring)
  562.  
  563.     variable    = Environment variable.
  564.     valuestring = The new value for the environment variable.
  565.         result      = Always 1.
  566.  
  567.     This function (creates and) sets the environment variable to a
  568. a (new) value. If 'valuestring' is missing, the function will remove the
  569. environment variable.
  570.  
  571. ScreenToBack, ScreenToFront
  572. ===========================
  573.  
  574.     These functions depth arrange screens. If no argument is specified,
  575. the screen operated on is the Workbench screen. If the name of a public screen
  576. is specified, it will be affected.
  577.  
  578.     Calling sequence:
  579.  
  580.     result = screentoback(publicscreen)
  581.     result = screentofront(publicscreen)
  582.  
  583.         publicscreen  = Name of a public screen (optional).
  584.  
  585.     The argument is optional. If 'publicscreen' is specified, the
  586. function will try to find the screen of that name. If it is set up properly,
  587. the function will operate on that screen. If not, the function will operate on
  588. the Workbench. Under AmigaDOS 1.3, screenshare.library is used for this
  589. purpose. Under AmigaDOS 2.0 a "public" screen of that name will be looked for
  590. and if this fails, screenshare.library is used, if it is in libs:.
  591.  
  592. ScreenRows, ScreenCols, ScreenLace
  593. ==================================
  594.  
  595.     These functions retrieve info about screens. If no argument is
  596. specified, the screen operated on is the Workbench screen. If the name of
  597. a public screen is specified, it will be used.
  598.  
  599.     Calling sequences:
  600.  
  601.     result = ScreenRows(publicscreen)     /* return number of rows */
  602.     result = ScreenCols(publicscreen)     /* return number of columns */
  603.     result = ScreenLace(publicscreen)     /* return interlace */
  604.  
  605.         publicscreen  = Name of a public screen (optional)
  606.  
  607.     ScreenRows and ScreenCols retrieve the number of rows and columns in
  608. pixels. The function ScreenLace() returns 0 if the screen is not interlaced, and
  609. 1 if it is. The functions return -1 if the information could not be found, as is
  610. the case if the named public screen does not exist. Notice, that
  611. ScreenRows/Cols/Lace can be used to determine whether a public screen of a
  612. particular name exists.
  613.     The argument is optional. If 'publicscreen' is specified, the
  614. function will try to find the screen of that name. If it is set up properly,
  615. the function will operate on that screen. If not, the function will operate on
  616. the Workbench. Under AmigaDOS 1.3, screenshare.library is used for this
  617. purpose. Under AmigaDOS 2.0 a "public" screen of that name will be looked for
  618. and if this fails, screenshare.library is used, if it is in libs:.
  619.  
  620. ScreenColor
  621. ===========
  622.  
  623.     result = ScreenColor(publicscreen, n)          /* get color n     */
  624.  
  625.            or
  626.  
  627.         result = ScreenColor(publicscreen, n, R, G, B) /* get/set color n */
  628.  
  629.         publicscreen  = Name of a public screen.
  630.         n             = Number of color to retrieve/modify
  631.         R             = The amount of red in the new color   (0 - 15)
  632.         G             = The amount of green in the new color (0 - 15)
  633.         B             = The amount of blue in the new color  (0 - 15)
  634.  
  635.     ScreenColor retrieves the RGB values of the selected color in the
  636. format: <red><space><green><space><blue>, e.g:   15 0 0  for an all red
  637. screen. When the R G and B arguments are also given, the indicated color of
  638. the screen is modified to the new values. The *old* color values will be
  639. returned in result. ScreenColor only operates on public screens. The function
  640. will try to find the screen of that name. If it is set up properly, the
  641. function will operate on that screen. Under AmigaDOS 1.3, screenshare.library
  642. is used for this purpose. Under AmigaDOS 2.0 a "public" screen of that name
  643. will be looked for and if this fails, screenshare.library is used, if it is
  644. in libs:.
  645.  
  646. MoveScreen
  647. ==========
  648.  
  649.     result = MoveScreen(publicscreen, dx, dy)
  650.  
  651.         publicscreen  = Name of a public screen.
  652.         dx            = Amount to move it in X
  653.         dy            = Amount to move it in Y
  654.  
  655.         result        = 0 on failure. <xy> on success.
  656.  
  657.         MoveScreen moves an existing public screen by the specified amounts
  658. in x and y. Arguments that are left out are interpreted as 0. This function
  659. is of rather limited use in AmigaDOS 1.3: only movement in the y direction
  660. is supported, and negative values beyond the top of the screen are not allowed.
  661. If the function failed, 0 is returned, otherwise a string is returned with the
  662. actual position of the screen in the form <x> <space> <y>. Note that by leaving
  663. out both arguments, you will find the current position of the screen.
  664.     The function will try to find the screen of that name. If it is set
  665. up properly, the function will operate on that screen. Under AmigaDOS 1.3,
  666. screenshare.library is used for this purpose. Under AmigaDOS 2.0 a "public"
  667. screen of that name will be looked for and if this fails, screenshare.library
  668. is used, if it is in libs:.
  669.  
  670. OpenScreen, CloseScreen
  671. =======================
  672.  
  673.     These functions allow you to open public custom screens.
  674.  
  675.     Calling sequence:
  676.  
  677.     result = OpenScreen(topedge, depth, modes, defaulttitle, publicscreen,
  678.                             penlist, width, height, leftedge)
  679.     result = CloseScreen(publicscreen)
  680.  
  681.     topedge       = Y coordinate of top edge of the screen.
  682.     depth         = Number of bitplanes.
  683.     modes         = Viewmodes and type of screen. The currently supported
  684.                         viewmodes are "HIRES", "LACE", and "HAM". Currently
  685.                         supported types are "SCREENBEHIND", "TRUNCATE",
  686.                         "AUTOSCROLL" and "OVERSCAN".
  687.     defaulttitle  = Default title for the screen title bar.
  688.         publicscreen  = Name of the public screen
  689.         penlist       = String of the form <pen1><pen2>...<pen9>. Example:
  690.                         "121213102"   where:
  691.              |||||||||
  692.              ||||||||+-> HIGHLIGHTTEXTPEN special color text
  693.              |||||||+--> BACKGROUNDPEN    always color 0
  694.              ||||||+---> FILLTEXTPEN      text over FILLPEN
  695.              |||||+----> FILLPEN          active-window/selected-gadget fill
  696.              ||||+-----> SHADOWPEN        dark edge on 3D objects
  697.              |||+------> SHINEPEN         bright edge on 3D objects
  698.              ||+-------> TEXTPEN          text on background
  699.              |+--------> BLOCKPEN         Intuition block pen
  700.              +---------> DETAILPEN        Intuition detail pen
  701.         width         = Width of the screen
  702.         height        = Height of the screen
  703.         leftedge      = X-coordinate of left edge of the screen
  704.  
  705.     result        = 0 on failure, 1 on success.
  706.  
  707.     The screen name is required, therefore you must supply sufficient
  708. commas and a name for the public screen to be created/closed. With openscreen,
  709. leaving out any of the other arguments will cause defaults to be used. They are
  710. topedge = 0, depth = 2, modes = 0 (meaning LORES, no LACE), no default title,
  711. leftedge = 0, width and height the same as of the Workbench. This is equivalent
  712. to specifying 0 for all arguments (a depth of 0 is illegal and will be changed
  713. to 2). All created screens are CUSTOM screens under AmigaDOS 1.3 using
  714. "screenshare.library" and PUBLIC screens under AmigaDOS 2.0.
  715. The "TRUNCATE" screen type is not really an Intuition construct. It is only
  716. useful when "topedge" is non-zero: the screen will have the size of its visible
  717. portion at the time it is opened. Otherwise a full sized screen is opened,
  718. which is just displaced by "topedge". With rexxarplib version 2.8 and later,
  719. this option is really obsolete, since one can now specify the height of the
  720. screen.
  721.     ***NOTE: It is perfectly possible to apply closescreen() to another
  722. application's custom screen (if it is public, using the same conventions as
  723. used here). If you attempt this under AmigaDOS 1.3, a software failure is
  724. almost guaranteed. Only use closescreen() on screens you created using
  725. openscreen()!
  726.  
  727. ShowTitle
  728. =========
  729.  
  730.     This function shows or hides the title bar of a named public
  731. screen.
  732.  
  733.     Calling sequence:
  734.  
  735.     result = ShowTitle(publicscreen, yesno)
  736.  
  737.     publicscreen  = name of a publicscreen
  738.     yesno         = 0 or 1.
  739.  
  740.     If yesno is set to 1, the screen title of the named public screen
  741. will be shown, if set to 0, it will be hidden. The function will try to find
  742. the screen of that name. If it is set up properly, the function will operate
  743. on that screen. If not, the function will operate on the Workbench. Under
  744. AmigaDOS 1.3, screenshare.library is used for this purpose. Under AmigaDOS
  745. 2.0 a "public" screen of that name will be looked for and if this fails,
  746. screenshare.library is used, if it is in libs:. This function does not
  747. operate on the Workbench.
  748.  
  749.  
  750. FileList
  751. ========
  752.  
  753.     This function does ARP pattern matching. Given a pattern, it will
  754. return all files and/or directories matching the pattern.
  755.  
  756.     Calling sequence:
  757.  
  758.     number = FileList(pattern, stem, type, expand)
  759.  
  760.     pattern       = a search pattern using ARP wildcards.
  761.         stem          = the NAME of a stem variable to be created.
  762.         type          = D - directories only. F - files only.
  763.         expand        = E - expand full path name. N - remove path name
  764.                     not specified: don't expand, but don't remove either.
  765.  
  766.     number        = the number of files matching the pattern.
  767.  
  768.     When files with names matching the  pattern are found, a stem variable
  769. with the name given by 'stem' is created in the current Rexx context. It has
  770. fields 1, 2, ... , <number> containing the names of the files. The return value
  771. and also the stem variable's field 0 are equal to the number of files. The last
  772. two arguments are optional: with 'type', when an F is specified, only files are
  773. listed. When a D is specified only directories are listed. With 'expand', if an
  774. E is specified, the full path name is expanded. If an N is specified, any
  775. pathname part of the pattern will be removed. Example: a simple directory
  776. program looks like
  777.  
  778.     /* Directory program, list everything, with full path */
  779.     arg pattern
  780.     if pattern = "" then pattern = "*"
  781.     numfils = FileList(pattern, myfilelist, , E)
  782.     do i = 1 to numfils; say myfilelist.i; end
  783.     exit
  784.  
  785.  
  786. SendParsed
  787. ==========
  788.  
  789.     This function sends a filled in ARexx message to a port.
  790.  
  791.     Calling sequence:
  792.  
  793.     result = SendParsed(port, arg0, arg1, arg2, arg3, ..., arg13)
  794.  
  795.     port          = Portname to send ARexx message to.
  796.         argn          = Arguments of the message.
  797.  
  798. This function takes the 14 arguments, puts them in an ARexx message and sends
  799. it to the 'port'. Only the first argument (port) is required, though it is
  800. usually advisable to send at least an arg0. Note that ARexx messages can have
  801. 16 arguments, but the last two are unavailable because of how library calls
  802. like these are implemented.
  803.  
  804.  
  805. CreateHost
  806. ==========
  807.  
  808.     This function allows you to create a single window with gadgets, menus,
  809. text, graphics, etc. Of course, multiple copies of the function may be started
  810. up to create more windows, but each must have a unique 'controlport'. This
  811. function should be started up asynchronously, using runwsh, and one should wait
  812. for the 'controlport' to appear using e.g. WaitForPort.
  813.  
  814.     Calling sequence:
  815.  
  816.     runwsh 'call CreateHost(controlport, notifyport, publicscreen)'
  817.  
  818.     controlport   = Name of the message port this window should listen to.
  819.     notifyport    = Name of the message port that should be notified when
  820.                         an IDCMP event occurs.
  821.         publicscreen  = Name of a public screen (optional).
  822.  
  823.     When the function is first called, it will open a message port with the
  824. name given by "controlport". The function will then wait for commands coming in
  825. through this port. This may be accomplished using one of many intuition
  826. functions, as explained later. One of the first commands should be to open the
  827. associated window by calling OpenWindow (see later). It will then open a window
  828. as specified in the OpenWindow call. If any message arrives through the IDCMP of
  829. this window, a REXX message will be sent to the port specified as "notifyport"
  830. which either you should set up in your rexx macro for this purpose, or should be
  831. an otherwise existing rexx message port belonging to another process. In the
  832. case you set up your own port, make sure the message is replied to after having
  833. been  retrieved and examined. If the  notifyport does not exist, no message will
  834. be sent. The window can be closed by the rexx macro by calling the function
  835. CloseWindow (see later). On startup, the notify port is the same for all classes
  836. of messages. This can be changed using the SetNotify() function, see later.
  837.     The last argument is optional. If 'publicscreen' is specified, the
  838. function will try to find the screen of that name. If it is set up properly,
  839. the window will open on that screen. If not, the window will open on
  840. the Workbench. Under AmigaDOS 1.3, screenshare.library is used for this
  841. purpose. Under AmigaDOS 2.0 a "public" screen of that name will be looked for
  842. and if this fails, screenshare.library is used, if it is in libs:.
  843.  
  844. Supported Intuition (and other) functions with createhost
  845. =========================================================
  846.  
  847.     The following functions are implemented as CreateHost functions. The
  848. first argument is always the name of the control port of the host that is
  849. supposed to execute the command. A little secret: you can send commands
  850. *directly* to the controlport also by constructs like "Address controlport
  851. commandname". However, this only works for commands without further arguments.
  852. For example, from WShell, "address controlport CloseWindow" is equivalent to
  853. "call CloseWindow(controlport)". This can come in incredibly handy at times.
  854. For example, when you want command hosts to send message to themselves: you
  855. can tell a host to send IDCMP events of class CLOSEWINDOW to itself...
  856. Boggles the mind yet? Read on...
  857.  
  858.    call ActivateGadget(controlport, gadgetid)
  859.         Tries to activate a string gadget with id 'gadgetid'.
  860.  
  861.    call ActivateWindow(controlport)
  862.  
  863.    call AreaCircle(controlport, xcenter, ycenter, radius)
  864.  
  865.    call AreaDraw(controlport, x, y)
  866.  
  867.    call AreaEllipse(controlport, xcenter, ycenter, radius1, radius2)
  868.  
  869.    call AreaEnd(controlport, pen)
  870.         The "pen" argument is optional, and overrides the default, which is
  871.         that the area fill should be done using the current A pen (set with
  872.         SetAPen()). Pen values less than 256 have the usual meaning. Pen
  873.         values of 256 + i, where i = 0 through 15, cause the fill to be
  874.         performed using one of 16 standard fill patterns. Pen values of
  875.     512 + i, where i = 0 through 124, cause the fill to be performed
  876.     using one of 125 dithering patterns. The dithering patterns use pens
  877.     0 through 7. If these pens are set to black, white, red, green, blue,
  878.     cyan, magenta and yellow respectively, then the dithering patterns
  879.     form 125 different colors. To calculate a particular color index for
  880.         use as "pen", take the color's R G and B values, where R, G and B
  881.         are 0, 1, 2, 3 or 4,  and use:
  882.  
  883.         pen = R * 25 + G * 5 + B
  884.  
  885.         For example, full white would be (R = 4, G = 4, B = 4) and pen = 124.
  886.     A bluish grey would be (2, 2, 3), pen = 63.
  887.     Adding 1024 to the pen number causes AreaEnd to have no effect at all.
  888.     Adding 2048 to the pen number will cause the fill to have an outline
  889.     with the outline pen being the current A pen.
  890.     The SetOPen function no longer affects Area draws as of this revision.
  891.         Bug: For some reason, area circles and ellipses don't seem to get
  892.         outlines when requested.
  893.  
  894.    call AreaMove(controlport, x, y)
  895.  
  896.    call AddGadget(controlport, x, y, gadgetid, gadgettext, messagetext,
  897.                   hsize, flags)
  898.         If hsize is specified, this call creates a string gadget of that
  899.         horizontal size and gadgettext is the default string. If hsize is
  900.         not specified, this call creates an autosizing boolean gadget, where
  901.         the text in gadgettext is displayed. In both cases, the string in
  902.         messagetext is sent to controlport (see also under OpenWindow). As
  903.         usual, the gadgettext for boolean gadgets may contain \ characters
  904.         to cause multiple lines of text (See e.g. PostMsg()). Under 2.0,
  905.         a flag can be specified for string gadgets: RIDGEBORDER. This will
  906.         cause the gadget to be displayed in the "2.0" style. Since this style
  907.         of gadget is a little different in size and location than non-ridge
  908.         border gadgets, the default is the usual gadget border under 1.3 and
  909.         a "recessed" gagdet under 2.0.
  910.  
  911.    call AddItem(controlport, itemname, message, commandchar, mutualexclude, flag)
  912.         Add a new item with name 'itemname'. Optionally, you may specify a
  913.         command key abbreviation (right-Amiga 'commandchar') and a mutual exclude
  914.         mask. See Intuition manual. A special value of the mutual exclude mask
  915.         is -1: this means that the item will be toggle selectable. If the flag
  916.         argument is "SAMELINE", the item will be on the same line as the previous
  917.         item, otherwise, or if the argument is not present, it will be on the
  918.         next line.
  919.         See also AddMenu(), AddSubItem(), RemoveMenu(), SetItem().
  920.  
  921.    call AddMenu(controlport, menuname)
  922.         Add a new menu with name 'menuname'. See also AddItem(), AddSubItem(),
  923.         RemoveMenu(), SetItem().
  924.  
  925.    call AddSubItem(controlport,itemname,message,commandchar,mutualexclude,flag)
  926.         Add a new subitem with name 'itemname'. Optionally, you may specify a
  927.         command key abbreviation (right-Amiga 'commandchar') and a mutual exclude
  928.         mask. See Intuition manual. A special value of the mutual exclude mask
  929.         is -1: this means that the item will be toggle selectable. If the flag
  930.         argument is "SAMELINE", the item will be on the same line as the previous
  931.         item, otherwise, or if the argument is not present, it will be on the
  932.         next line.
  933.         See also AddMenu(), AddItem(), RemoveMenu(), SetItem().
  934.  
  935.    call BackFill(controlport)
  936.         This is not an intuition function. See OpenWindow().
  937.  
  938.    call CloseWindow(controlport, flag)
  939.         This function closes the window and deallocates all resources. The 'flag'
  940.         argument is optional. If present, and if the flag is equal to "CONTINUE",
  941.         the host will remain active. Otherwise, the host will exit.
  942.  
  943.    call Draw(controlport, x, y)
  944.  
  945.    call DrawCircle(controlport, xcenter, ycenter, radius)
  946.  
  947.    call DrawEllipse(controlport, xcenter, ycenter, radius1, radius2)
  948.  
  949.    call Exit(controlport)
  950.         This function closes the window, deallocates all resources and causes
  951.         the host to exit. Exit(), Quit() and Stop() are identical.
  952.  
  953.    call Flood(controlport, mode, x, y)
  954.         If mode is 0, the flood continues until pixels of the outline pen
  955.         color are found. If the mode is 1, the flood continues until pixels
  956.         of a different color than the pixel at x, y are found.
  957.  
  958.    call RemoveMenu(controlport)
  959.         Gets rid of any attached menu.
  960.  
  961.    call IFFImage(controlport, filename, x, y, width, height, flag)
  962.         Displays a chunk of size 'width', 'height' of an IFF ILBM file named
  963.         'filename' at x, y in the window. If x, y, width, and/or height are
  964.         omitted, suitable defaults are chosen. The colormap of the IFF file,
  965.         if any, is NOT used on the Workbench, but IS used on custom screens.
  966.         The 'flag' option can be set to 'NOCOLOR' (N is sufficient) to prevent
  967.         modifying the custom screen's colors.
  968.  
  969.    call ModifyHost(controlport, IDCMPclass, messagestring)
  970.         This function allows you to set the message string that is sent to
  971.         the notifyport for a particular class of IDCMP events. See OpenWindow.
  972.  
  973.    call Move(controlport, x, y)
  974.  
  975.    call OpenWindow(controlport, leftedge, topedge, width, height,
  976.                                 idcmp, flags, title)
  977.         width and height may be set to 0 to get the maximum size of the window.
  978.         idcmp is a string that specifies the IDCMP for the window. Supported are:
  979.  
  980.            IDCMP message    |  default arg[0]
  981.         --------------------+-------------------
  982.           "CLOSEWINDOW"     |  "%l"
  983.           "MOUSEBUTTONS"    |  "%l"
  984.           "GADGETUP"        |  <its string>
  985.           "GADGETDOWN"      |  <its string>
  986.           "MENUPICK"        |  "%l"
  987.           "NEWSIZE"         |  "%l"
  988.           "VANILLAKEY"      |  "%l"
  989.           "RAWKEY"          |  "%l"
  990.           "NEWPREFS"        |  "%l"
  991.           "DISKINSERTED"    |  "%l"
  992.           "DISKREMOVED"     |  "%l"
  993.           "ACTIVEWINDOW"    |  "%l"
  994.           "INACTIVEWINDOW"  |  "%l"
  995.           "REFRESHWINDOW"   |  "%l"
  996.           "MOUSEMOVE"       |  "%l"
  997.           "DELTAMOVE"       |  "%l"
  998.  
  999.         Any number of these may be specified in the OpenWindow call, by conca-
  1000.         tenation. When any of these messages arrives at the IDCMP, a REXX
  1001.         message is created with a particular string in Arg[0]. This string is
  1002.         by default the one given in the table above, after substitution has
  1003.         taken place for any two-character sequence starting with '%'.
  1004.         The following substitutions will be made:
  1005.  
  1006.         Sequence: | Typical Use: |     Meaning:
  1007.         ----------+--------------+---------------
  1008.             %%    |              | A single % sign
  1009.             %a    | Vanillakeys  | 'Code' is interpreted as an ASCII character.
  1010.             %b    | Buttons      | SELECTDOWN, SELECTUP, MENUDOWN, MENUUP.
  1011.             %c    |              | 'Code' is given as an integer.
  1012.             %d    | Gadgets      | the gadget id.
  1013.             %e    | Window       | the TopEdge of the window
  1014.             %f    | Window       | the LeftEdge of the window
  1015.             %g    | Gadgets      | the string inside a string gadget goes here.
  1016.             %h    | Newsize      | the window height.
  1017.             %i    | Menus        | the item number.
  1018.             %l    | Any          | the name of the IDCMP class.
  1019.             %m    | Menus        | the menu number.
  1020.             %q    |              | 'Qualifier' is given as an integer.
  1021.             %s    | Menus        | the sub-item number.
  1022.             %t    | Time         | the number of seconds since January 1 1980.
  1023.             %w    | Newsize      | the window width.
  1024.             %x    | Mouse        | the X position of the mouse pointer.
  1025.             %y    | Mouse        | the Y position of the mouse pointer.
  1026.           %0-%15  |              | which Arg to use.
  1027.  
  1028.         For example, if the message string of some gadget is
  1029.  
  1030.             "Mouse is %x, %y%3gadget string is %g"
  1031.  
  1032.         the following might be sent to the notifyport in Arg[0] when someone
  1033.         hits return in that gadget, after typing "This is a test":
  1034.  
  1035.             Mouse is 320, 200
  1036.  
  1037.         while Arg[3] of the Rexx message would contain the string:
  1038.  
  1039.             gadget string is This is a test
  1040.  
  1041.         The default string for non-gadgets/menus is "%l", which means that they
  1042.         only report their name. For example, if one would click in the window,
  1043.         one would only receive a message with "MOUSEBUTTONS" in Arg[0]. However,
  1044.         all arguments of the message that will be sent to the notifyport may be
  1045.         changed using the ModifyHost() call, see there. Any of the escape
  1046.         sequences above may be used in any string. Obviously, sometimes
  1047.         particular sequences may not be very appropriate for certain uses.
  1048.  
  1049.         'flags' specifies the various window flags. Currently supported are:
  1050.         "WINDOWCLOSE", "WINDOWSIZING" (and "SIZEBRIGHT", "SIZEBBOTTOM"),
  1051.         "WINDOWDEPTH", "WINDOWDRAG", "BORDERLESS", "ACTIVATE", "BACKDROP" and
  1052.         "NOCAREREFRESH".   A special flag can be set: "BACKFILL". It implies
  1053.         a call to BackFill() after opening the window. It sets the window's
  1054.         background to the current requester-style background color.
  1055.  
  1056.    call Quit(controlport)
  1057.         This function closes the window, deallocates all resources and causes
  1058.         the host to exit. Exit(), Quit() and Stop() are identical.
  1059.  
  1060.    call ReadGadget(controlport, gadgetid)
  1061.         This function will cause the gadget 'gadgetid' to send its message
  1062.         text (after substitutions, of course).
  1063.  
  1064.    call ReadHost(controlport, notifyport, messagetext)
  1065.         This function will cause the message text (after substitutions, of
  1066.         course) to be sent to the notifyport.
  1067.  
  1068.    call RectFill(controlport, xmin, ymin, xmax, ymax)
  1069.  
  1070.    call RefreshGadgets(controlport)
  1071.  
  1072.    call RemoveGadget(controlport, gadgetid)
  1073.  
  1074.    call SetAPen(controlport, pennumber)
  1075.  
  1076.    call SetBPen(controlport, pennumber)
  1077.  
  1078.    call SetDrMd(controlport, mode)
  1079.         mode can be any of JAM1, JAM2, INVERSVID or COMPLEMENT.
  1080.  
  1081.    call SetDrPt(controlport, pattern)
  1082.         pattern is interpreted as a long integer of which the bits form the
  1083.         pattern.
  1084.  
  1085.    call SetFont(controlport, FontName, FontSize, FontStyle, FontFlags, XSize)
  1086.         Change the font to the one specified. If the font doesn't exist or
  1087.         doesn't exist in the specified FontSize, the function does
  1088.         nothing. If the font does exist, the closest match FontStyle and
  1089.         FontFlags font is returned that is currently in memory or if it is
  1090.         not in memory, that is currently in fonts:. If XSize is specified,
  1091.         the font will be rejected also if the horizontal size doesn't match.
  1092.         FontStyle bits:
  1093.  
  1094.               none = Normal
  1095.               1    = Underlined
  1096.               2    = Bold
  1097.               4    = Italic
  1098.               8    = Extended face (wider than normal)
  1099.               64   = Color font
  1100.  
  1101.         Note that the function calls SetSoftStyle() internally to fake any
  1102.         of the attributes if the closest font doesn't match the requirements.
  1103.         FontFlag bits:
  1104.  
  1105.               1    = Font is in ROM
  1106.               2    = Font is from diskfont.library
  1107.               4    = Font is reverse path (left to right)
  1108.               8    = designed for hires non-interlaced
  1109.               16   = designed for lores interlaced
  1110.               32   = Font is proportional
  1111.               64   = Font is designed
  1112.  
  1113.         This function requires that diskfont.library is present in libs:.
  1114.  
  1115.    call SetGadget(controlport, gadgetid, action)
  1116.         Given a gadget id, perform action on the gadget. Supported are ON and
  1117.         OFF, to set or clear the highlighting state of the gadget.
  1118.  
  1119.    call SetItem(controlport, menunumber, itemnuber, subitemnumber, action)
  1120.         Given menu, item (and optionally subitem) numbers, perform action on
  1121.         the menu item. Supported are ON and OFF, to set or clear the check mark.
  1122.         Remember that menu, item and subitem numbers start from 0.
  1123.  
  1124.    call SetNotify(controlport, IDCMPclass, newnotifyport)
  1125.         This function allows you to change the name of the NotifyPort that
  1126.         message strings are sent to for a particular class of IDCMP events.
  1127.  
  1128.    call SetReqColor(controlport, pentype, colornumber)
  1129.         This function allows you to change the color number assigned to
  1130.         one of the various pentypes. Currently the pentypes are: BLOCKPEN,
  1131.         DETAILPEN, BACKGROUNDPEN, PROMPTPEN, BOXPEN, SHADOWPEN, OKAYPEN,
  1132.         and CANCELPEN.
  1133.  
  1134.    call SetOPen(controlport, pennumber)
  1135.         SetOpen is mostly obsolete, see AreaEnd().
  1136.  
  1137.    call SetRGB4(controlport, pennumber, red, green, blue)
  1138.         red, green and blue are values for the RGB content of the color to be
  1139.         assigned to the pen. The values are taken mod 16.
  1140.  
  1141.    call Stop(controlport)
  1142.         This function closes the window, deallocates all resources and causes
  1143.         the host to exit. Exit(), Quit() and Stop() are identical.
  1144.  
  1145.    call Text(controlport, string)
  1146.  
  1147.    call WindowText(controlport, text)
  1148.         The string in text may contain \'s to indicate multiple lines of text.
  1149.  
  1150.    call WindowToBack(controlport)
  1151.  
  1152.    call WindowToFront(controlport)
  1153.  
  1154.    call WritePixel(controlport, x, y)
  1155.  
  1156.  
  1157.  
  1158.  
  1159.